Higher-order and Symbolic Computation Manuscript No. Functional Un|unparsing

نویسندگان

  • Kenichi Asai
  • Oleg Kiselyov
  • Chung-chieh Shan
چکیده

Danvy’s functional unparsing problem (Danvy 1998) is to implement a typesafe ‘printf’ function, which converts a sequence of heterogeneous arguments to a string according to a given format. The dual problem is to implement a type-safe ‘scanf’ function, which extracts a sequence of heterogeneous arguments from a string by interpreting (Friedman and Wand 1984, 2008) the same format as an equally heterogeneous sequence of patterns that binds zero or more variables. We derive multiple solutions to both problems (Wand 1980b) from their formal specifications (Wand 1982b). On one hand, our solutions show how the Hindley-Milner type system, unextended, permits accessing heterogeneous sequences with the static assurance of type safety. On the other hand, our solutions demonstrate the use of control operators (Felleisen et al. 1988; Meyer and Wand 1985; Wand 1985) to communicate with formats as coroutines (Haynes et al. 1984; Wand 1980a).

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

On typing delimited continuations: three new solutions to the printf problem

In “Functional Unparsing” (JFP 8(6): 621–625, 1998), Danvy presented a type-safe printf function using continuations and an accumulator to achieve the effect of dependent types. The key technique employed in Danvy’s solution is the non-standard use of continuations: not all of its calls are tail calls, i.e., it uses delimited continuations. Against this backdrop, we present three new solutions ...

متن کامل

Comparing Parallel Functional Languages: Programming and Performance

This paper presents a practical evaluation and comparison of three state-of-the-art parallel functional languages. The evaluation is based on implementations of three typical symbolic computation programs, with performance measured on a Beowulf-class parallel architecture. ∗This work is primarily supported by the Austrian Academy of Sciences (APART fellowship 624), the Japan Society for the Pro...

متن کامل

Cost-Augmented Partial Evaluation of Functional Logic Programs

We enhance the narrowing-driven partial evaluation scheme for lazy functional logic programs with the computation of symbolic costs. The enhanced scheme allows us to estimate the effects of the program transformer in a precise framework and, moreover, to quantify these effects. The considered costs are “symbolic” in the sense that they measure the number of basic operations performed during a c...

متن کامل

Christopher Strachey: Recollections of His Influence

My early research was inspired by the mathematical semantics of Scott and Strachey. Two such topics, recounted in this paper, were the fixed-point analysis of pointer loops and the expressibility of a style of functional programming introduced by Barron and Strachey.

متن کامل

Adapting functional programs to higher order logic

Higher-order logic proof systems combine functional programming with logic, providing functional programmers with a comfortable setting for the formalization of programs, specifications, and proofs. However, a possibly unfamiliar aspect of working in such an environment is that formally establishing program termination is necessary. In many cases, termination can be automatically proved, but th...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014